<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@include file="../base/taglibs.jsp" %>
<ssm:overwrite name="style">
<link rel="stylesheet" href="${STATIC}/css/dropzone.css" />
</ssm:overwrite>
<ssm:overwrite name="context">
	<div class="alert alert-info">
		<i class="icon-hand-right"></i>拖拽文件上传
		<button class="close" data-dismiss="alert">
			<i class="icon-remove"></i>
		</button>
	</div>

	<div id="dropzone">
		<form action='uploadFile' class="dropzone" method="post"
			enctype="multipart/form-data">
			类型:<select name="resouretypeid">
				<c:forEach items="${typelist}" var="item">
					<option value="${item.id}">${item.name}</option>
				</c:forEach>
			</select>
			name:<input type="text" name="name" value="${item.name}">
				 <input name="picid" type="hidden" value="${item.id}">
			<div class="fallback">
				<input name="file" type="file"/>
			</div>
		</form>
	</div>

</ssm:overwrite>
<ssm:overwrite name="script">
<script src="${STATIC}/js/dropzone.min.js"></script>
<script type="text/javascript">
$(function()
{
	$('option[value="${item.resouretypeid}"]').attr("selected","selected");

	try {
		  $(".dropzone").dropzone({
		    paramName: "file", // The name that will be used to transfer the file
		    maxFilesize: 10, // MB
			addRemoveLinks : true,
			uploadMultiple: true,
			dictDefaultMessage :
			'<span class="bigger-150 bolder"><i class="icon-caret-right red"></i> 拖拽文件</span>上传 \<span class="smaller-80 grey">(点击)</span> <br /> \<i class="upload-icon icon-cloud-upload blue icon-3x"></i>',
			dictResponseError: 'Error while uploading file!',
			previewTemplate: "<div class=\"dz-preview dz-file-preview\">\n  <div class=\"dz-details\">\n    <div class=\"dz-filename\"><span data-dz-name></span></div>\n    <div class=\"dz-size\" data-dz-size></div>\n    <img data-dz-thumbnail />\n  </div>\n  <div class=\"progress progress-small progress-striped active\"><div class=\"progress-bar progress-bar-success\" data-dz-uploadprogress></div></div>\n  <div class=\"dz-success-mark\"><span></span></div>\n  <div class=\"dz-error-mark\"><span></span></div>\n  <div class=\"dz-error-message\"><span data-dz-errormessage></span></div>\n</div>"
		  });
		} catch(e) {
		  alert('Dropzone.js does not support older browsers!');
		}

	
});
</script>
</ssm:overwrite>
<jsp:include page="../base/base.jsp"></jsp:include>